package cn.tsvtc.shop.utils;/**
 * @Author Athena
 * @Date 2020/10/29 17:32
 * @Version 1.0
 * @Description no description
 */

import java.util.Random;

/**
 * @author: Athena
 * @date: 2020/10/29 17:32
 * @description: 获取随机数字或字母验证码
 */
public class CodeUtils {

    public static String getRandomIntCodes(int count) {
        String depository = "1234567890";
        String result = "";
        Random random = new Random();
        for (int i = 0; i < count; i++) {
            int index = random.nextInt(depository.length());
            char c = depository.charAt(index);
            result += c;
        }
        return result;

    }

    public static String getRandomAllCodes(int count) {
        String depository = "qweeirujhgdjklscmnxzvbxnc1234567890";
        String result = "";
        Random random = new Random();
        for (int i = 0; i < count; i++) {
            int index = random.nextInt(depository.length());
            char c = depository.charAt(index);
            result += c;
        }
        return result;

    }

    public static void main(String[] args) {
        System.out.println("你大爷的");
    }
}
